import request from '@/utils/request'

export function getList(query) {
  return request({
    url: '/theme/list',
    method: 'get',
    params: query
  })
}

export function getCoverProduct(themeId) {
  return request({
    url: '/theme/getCoverProduct/'+themeId,
    method: 'get'
  })
}

export function getMoreProduct(query) {
  return request({
    url: '/theme/getMoreProduct',
    method: 'get',
    params: query
  })
}

export function getCandidateProduct(query) {
  return request({
    url: '/theme/getProducts',
    method: 'get',
    params: query
  })
}

export function addProduct(data) {
  return request({
    url: '/theme/addProduct',
    method: 'post',
    data
  })
}

export function deleteThemeProduct(data) {
  return request({
    url: '/theme/deleteThemeProduct',
    method: 'post',
    data
  })
}

export function updateThemeProduct(data) {
  return request({
    url: '/theme/updateThemeProduct',
    method: 'post',
    data
  })
}

export function saveTheme(data) {
  return request({
    url: '/theme/saveTheme',
    method: 'post',
    data
  })
}

export function getTheme(id) {
  return request({
    url: '/theme/getTheme/'+id,
    method: 'get'
  })
}
